package com.zhangtai.modules.service.employee;


import com.zhangtai.modules.entity.employee.EmployeeInfoEntity;
import com.zhangtai.modules.vo.RegularVo;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.PageUtils;
import com.zhangtai.utils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-06-15 11:54:06
 */

public interface EmployeeInfoService {

    @GetMapping("/findEmployeeInfoList")
    @ApiOperation(value = "分页查询")
    PageResult<EmployeeInfoEntity> queryPage(@RequestParam(value = "employeeOid", required = false) String employeeOid,
                                             @RequestParam(value = "name", required = false) String name,
                                             @RequestParam(value = "orgname", required = false) List<Long> orgname,
                                             @RequestParam(value = "unitname", required = false) List<Long> unitname,
                                             @RequestParam(value = "jobname", required = false) List<Long> jobname,
                                             @RequestParam(value = "status", required = false) List<Integer> status,
                                             @RequestParam(value = "isReinstate", required = false) Integer isReinstate,
                                             @RequestParam(value = "isEntryStatus", required = false) Integer isEntryStatus,
                                             @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                             @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                             @RequestParam(value = "orgIds") List<Long> orgIds,
                                             @RequestParam(value = "socialTrainee", required = false) Integer socialTrainee,
                                             @RequestParam(value = "isOffer", required = false) Integer isOffer,
                                             @RequestParam(value = "isSendContract", required = false) Integer isSendContract,
                                             @RequestParam(value = "userCode", required = false) String userCode
    );

    @GetMapping("/queryPageIsDistribute")
    public PageResult queryPageIsDistribute(@RequestParam(value = "isDistribute", required = false) Integer isDistribute,
                                            @RequestParam(value = "orgIds", required = false) List<Long> orgIds,
                                            @RequestParam(value = "code", required = false) String code,
                                            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                            @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    @GetMapping("/findHireListPage")
    @ApiOperation(value = "分页查询员工录用台账")
    PageResult findHireListPage(@RequestParam(value = "keyword", required = false) String keyword,
                                @RequestParam(value = "status", required = false) List<Integer> status,
                                @RequestParam(value = "isReinstate", required = false) Integer isReinstate,
                                @RequestParam(value = "code", required = false) String code,
                                @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                @RequestParam(value = "orgIds") List<Long> orgIds);

    public PageResult queryEmployeePage(@RequestParam(value = "name", required = false) String name,
                                        @RequestParam(value = "orgIds", required = false) List<Long> orgIds,
                                        @RequestParam(value = "code", required = false) String code,
                                        @RequestParam(value = "orgname", required = false) List<Long> orgname,
                                        @RequestParam(value = "unitname", required = false) List<Long> unitname,
                                        @RequestParam(value = "jobname", required = false) List<Long> jobname,
                                        @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                        @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);


    @GetMapping("/infoEmployeeInfo")
    @ApiOperation(value = "根据id查找")
    EmployeeInfoEntity getByIdE(@RequestParam("oid") Long id);

    @PostMapping("/saveEmployeeInfo")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody EmployeeInfoEntity entity);

    @PostMapping("/updateEmployeeInfo")
    @ApiOperation(value = "修改")
    @Transactional
    R updateByIdE(@RequestBody EmployeeInfoEntity entity);

    @GetMapping("/deleteOneEmployeeInfo")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteEmployeeInfos")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);

    @GetMapping("/findBySalaryBran")
    PageResult findBySalaryBran(@RequestParam(value = "keyword", required = false) String keyword,
                                @RequestParam(value = "orgIds", required = false) List<Long> orgIds,
                                @RequestParam(value = "code", required = false) String code,
                                @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    @DeleteMapping("/deleteSalaryBandMonitoring")
    R deleteSalaryBandMonitoring(@RequestParam("id") Long id);

    @GetMapping("/findRegularList")
    PageResult<EmployeeInfoEntity> getRegularList(@RequestBody RegularVo regularVo,
                                                  List<Long> jobSystem, List<Long> lineSystem,
                                                  List<Long> orgId,
                                                  @RequestParam(value = "org") List<Long> org,
                                                  @RequestParam(value = "unit") List<Long> unit,
                                                  @RequestParam(value = "job") List<Long> job);


    List<EmployeeInfoEntity> getRegularListReport(@RequestBody RegularVo regularVo,
                                                  List<Long> jobSystem, List<Long> lineSystem,
                                                  List<Long> orgId,
                                                  @RequestParam(value = "org") List<Long> org,
                                                  @RequestParam(value = "unit") List<Long> unit,
                                                  @RequestParam(value = "job") List<Long> job);

    EmployeeInfoEntity getEmployeeInfoByRegularBpmStatus(List<Integer> status,Long oid);

    PageUtils getAllEmployeeInfos(String orgname, String name, String unitname, String pageNum, String pageSize, String current,String jobname);

}

